package org.msi.bayesiannetwork;

/**
 * <p>Represents a single node within bayesian network.</p>
 *
 * @author Jakub Narloch
 * @version 1.0
 */
public abstract class AbstractNode {

    /**
     * <p>Represents the node identifier.</p>
     */
    private int id;

    /**
     * <p>Represents the node name.</p>
     */
    private final String name;

    /**
     * <p>Represents the node variable.</p>
     */
    private final String variable;

    /**
     * <p>Creates new instance of {@link AbstractNode} class, with specified name and variable.</p>
     *
     * @param name  the node name
     * @param variable the node variable
     */
    public AbstractNode(String name, String variable) {
        this.name = name;
        this.variable = variable;
    }

    /**
     * <p>Retrieves the node identifier.</p>
     *
     * @return the node identifier
     */
    public int getId() {
        return id;
    }

    /**
     * <p>Retrieves the node identifier.</p>
     *
     * @param id the node identifier
     */
    void setId(int id) {
        this.id = id;
    }

    /**
     * <p>Retrieves the node name.</p>
     *
     * @return the node name
     */
    public String getName() {
        return name;
    }

    /**
     * <p>Retrieves the node variable.</p>
     *
     * @return the node variable
     */
    public String getVariable() {
        return variable;
    }
}
